<html>
    <head>
        <title>
            ist gut
        </title>
<!--        <script type="text/javascript" src="jquery-1.6.4.min.js"></script>-->
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <link type="text/css" href="/Game/templates/js/custom/jquery-ui-1.8.20.custom.css" rel="Stylesheet" />
        <script src="/Game/templates/js/jquery-1.7.2.js"></script>
        <script src="/Game/templates/js/jquery-ui-1.8.20.custom.js"></script>
<!--	<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
	<script src="../../jquery-1.7.2.js"></script>-->
        <script src="/Game/templates/js/ui/jquery.ui.core.js"></script>
	<script src="/Game/templates/js/ui/jquery.ui.widget.js"></script>
	<script src="/Game/templates/js/ui/jquery.ui.mouse.js"></script>
	<script src="/Game/templates/js/ui/jquery.ui.resizable.js"></script>
<!--	<link rel="stylesheet" href="../demos.css">-->
	<style>
        body {
            overflow: auto;
        }
	#resizable { width: 90%; max-height: 90%; padding: 0.5em; }
	#resizable h3 { text-align: center; margin: 0; }
	</style>
	<script>
//	jQuery(function() {
//            jQuery('#date').datepicker();
//		jQuery( "#resizeable" ).resizable();
//	});
	</script>
</head>
    </head>
    <body>
        text


        <br>

<!--        <input type="text" name="date" id="date" />
<div id="resizable" class="ui-widget-content">
	<h3 class="ui-widget-header">Resizable</h3>
</div>-->


        <div id="resizeable" class="ui-widget-content">
<!--            <h3 class="ui-widget-header">Resizable</h3>-->
            <div id="myContent" style="overflow:auto; width:100%;min-height:90%;border:2px solid black;">content</div>
        </div>
<!--        <div style="float:left;border:2px solid green">-->
<!--            <input type="button" id="myButton" name="but" value="transfer">
            <textarea id="myText" cols="100" rows ="30">bling blong</textarea>-->
<!--        </div>-->
    </body>

    <script>
        jQuery(document).ready(function () {
            jQuery( "#resizeable" ).resizable();
//            jQuery('body').undelegate('#myButton', 'click');
//            jQuery('body').delegate('#myButton', 'click', function() {
            jQuery(document).keyup(function() {
//                var textFromTextArea = jQuery("#myText").val();
//                var textPreparedWithPlus = textFromTextArea.replace(/\+/g, "@");
//                console.log(textPreparedWithPlus);
//                var content = escape(textPreparedWithPlus);
                var content = 'work';
//                console.log(content);
                jQuery.ajax({
                    type: "POST",
                    url: "saveFile.php",
                    data: "text=" + content,
//                    datatype: 'json',
                    success: function(msg){
//                        console.log(msg);
//                        var newString = '';
                        newStringSpace = msg.replace(/%20/gi, "&nbsp;");
                        newStringNewLine = newStringSpace.replace(/%2F/gi, "\n");
//                        console.log(newStringSpace);
//                        msgUnescape = unescape(msg);
//                        msgUnescape = newStringSpace;
                        if ('' != newStringNewLine && null == newStringNewLine.match(/xdebug-error/)) {
                            console.log(newStringNewLine);
                            jQuery('#myContent').html(newStringNewLine);
                        }
                    },
                    error: function() {
                        alert('error occurred between ajax');
                    }
                });
            });
        });
        
    </script>
</html>